CREATE TABLE [dbo].[StockOutDetails]
(
[StockOutDetailId] [bigint] NOT NULL IDENTITY(1, 1),
[StockOutId] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DrugId] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Quantity] [int] NOT NULL,
[UnitPrice] [money] NOT NULL,
[ExpDate] [datetime] NULL,
[BatchLot] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Remark] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StockOutDetails] ADD CONSTRAINT [PK_StockOutDetails] PRIMARY KEY CLUSTERED  ([StockOutDetailId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[StockOutDetails] ADD CONSTRAINT [FK_StockOutDetails_DrugDispo] FOREIGN KEY ([DrugId]) REFERENCES [dbo].[DrugDispo] ([DrugId])
GO
ALTER TABLE [dbo].[StockOutDetails] ADD CONSTRAINT [FK_StockOutDetails_StockOut] FOREIGN KEY ([StockOutId]) REFERENCES [dbo].[StockOut] ([StockOutId])
GO
